#ifndef __PHYSICS__DEBUG__INCLUDED__HH__
#define __PHYSICS__DEBUG__INCLUDED__HH__

#include <Newton.h>
#include <Ogre.h>
#include <OgreOverlay.h>
#include "LitPhysicsPrereqs.h"
#include <LitSingleton.hpp>
#include <boost\bind.hpp>
#include <boost\function.hpp>

namespace Lit
{
	namespace Physics
	{
		class LIT_API Debugger
		{
		public:
			struct Object
			{
				Ogre::ManualObject * manual;
				Ogre::SceneNode * node;
				Ogre::SceneManager * scene;

				Object(  Ogre::SceneManager * mgr, Ogre::SceneNode * parent );
				~Object( );
			};
			typedef std::vector<Object*> NodeMap;

		protected:
			NodeMap mMap;
			Ogre::SceneManager *	mSceneMgr;
			World*					mWorld;
			bool					mVisible;

			void perPolygon( void * userData, int vert_cnt, const float * faceArray, int fid );

		public:
			Debugger(Ogre::SceneManager * mgr, World* world);
			~Debugger();

			void destroyNodes( );

			void setVisible( bool state );
			bool isVisible() const;

			void rebuildLines( );

		};
	};
};

#endif